package top.kaoshanji;

import com.google.common.io.Resources;

import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;

/**
 * author kaoshanji
 * ^_^
 * create time 2024/12/4 14:54
 */
public class GuavaTest {

    public static void main(String[] args) throws IOException {

        // 访问 resources 目录下的文件
        URL resource = Resources.getResource("ch05/corejava/title.txt");
        System.out.println(resource.getPath());

        String fileContent = Resources.toString(resource, StandardCharsets.UTF_8);
        System.out.println("fileContent: " + fileContent);

    }

}
